package com.codeduck;

import com.codeduck.constant.KafkaConst;
import lombok.extern.slf4j.Slf4j;
import org.springframework.kafka.annotation.KafkaListener;
import org.springframework.kafka.annotation.PartitionOffset;
import org.springframework.kafka.annotation.TopicPartition;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;

/**
 * @author: <a href="mailto:codeduck@163.com">Codeduck</a>
 * @date: 2023/3/5
 */
@Service
@Slf4j
public class BillConsumer {
    @KafkaListener(groupId = "BILL_CONSUMER_GROUP_TEST", topicPartitions = {
            @TopicPartition(topic = "KAFKA_APP1_BILL_NOTIFICATION", partitionOffsets = @PartitionOffset(partition = "0", initialOffset = "-1"))})
    public void consumerA(String msg) {
        log.info("KAFKA_APP1_BILL_NOTIFICATION: 获得消息 [{}]", msg);
    }
}
